package com.lmk.feign;


import com.lmk.domain.Store;
import com.lmk.utils.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class StoreServiceFallbackFactory implements FallbackFactory<StoreService> {
    @Override
    public StoreService create(Throwable throwable) {
        return new StoreService() {
            @Override
            public AjaxResult add(Store store) {
                return AjaxResult.me().setSuccess(false).setMsg("触发熔断！！！服务不可用");
            }
        };
    }
}
